<!-- modal template -->
<div class="modal-header">
    <h4 class="modal-title" id="myModalLabel">修改密码</h4>
</div>
<form ng-submit="submitForm(pwdForm.$valid)" name="pwdForm" class="form-horizontal" novalidate>
    <div class="modal-body">
        <div class="row" style="padding:0;">
            <div class="col-md-12">
                <div class="form-group">
                    <label class="col-md-3 control-label">旧密码</label>

                    <div class="col-md-9 has-feedback">
                        <input type="password" name="oldPassword" class="input-sm form-control"
                               ng-model="userData.oldPassword" ng-required="true" ng-keyup="confirmOldPwd()"/>
                        <span class="glyphicon glyphicon-ok form-control-feedback"
                              ng-show="pwdForm.oldPassword.$valid && oldPwdValid"></span>
                        <span class="input-error" ng-hide="oldPwdisValid"><i></i>旧密码填写有误</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-3 control-label">新密码</label>

                    <div class="col-md-9 has-feedback">
                        <input type="password" name="newPassword" class="input-sm form-control"
                               ng-model="userData.newPassword" ng-required="true"/>
                        <span class="glyphicon glyphicon-ok form-control-feedback"
                              ng-show="pwdForm.newPassword.$valid"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-3 control-label">确认新密码</label>

                    <div class="col-md-9 has-feedback">
                        <input type="password" name="rePassword" class="input-sm form-control"
                               ng-model="userData.rePassword" ng-required="true" ng-keyup="isConfirmPwd()"/>
                        <span class="glyphicon glyphicon-ok form-control-feedback"
                              ng-show="pwdForm.rePassword.$valid && userData.rePassword == userData.newPassword"></span>
                        <span class="input-error" ng-show="isConfirmPassword"><i></i>确认新密码与新密码不一致</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-default" ng-click="closeThisDialog()">取消</button>
        <button type="submit" class="btn btn-primary"
                ng-disabled="pwdForm.$invalid || !oldPwdisValid || userData.rePassword != userData.newPassword"
                ng-click="confirm()">确认
        </button>
    </div>
</form>
